package com.beiing.tianshuai.tianshuai.dongtai.presenter;

import com.beiing.tianshuai.tianshuai.dongtai.CallBack;
import com.beiing.tianshuai.tianshuai.dongtai.model.DynamicForwardModel;
import com.beiing.tianshuai.tianshuai.dongtai.model.DynamicForwardModelImpl;
import com.beiing.tianshuai.tianshuai.dongtai.view.DynamicForwardViewImpl;
import com.beiing.tianshuai.tianshuai.entity.DynamicForwardBean;

/**
 * Created by magikliu on 2017/8/4.
 */

public class DynamicForwardPresenter implements DynamicForwardPresenterImpl {

    private DynamicForwardViewImpl mView;
    private DynamicForwardModelImpl mModel;

    public DynamicForwardPresenter(DynamicForwardViewImpl mView) {
        this.mView = mView;
        mModel = new DynamicForwardModel();
    }

    @Override
    public void pushMyForward(String form_uid, String to_uid, String r_id, String content) {
        mModel.pushMyForward(form_uid, to_uid, r_id, content, new CallBack<DynamicForwardBean>() {
            @Override
            public void result(DynamicForwardBean bean) {
                mView.showForwardDynamic();
            }

            @Override
            public void error(Throwable e) {
                mView.showForwardDynamic();
            }
        });
    }
}
